home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacGames Sampler
/
PHT MacGames Bundle.iso
/
MacSource Folder
/
Samples from the CD
/
C and C++
/
POSIX
/
ThinkCPosix
/
pathconf.c
< prev
next >
Wrap
Text File
|
1992-09-14
|
519b
|
23 lines
/* $ld: $ */
#include <fcntl.h>
#include "ThinkCPosix.h"
long pathconf(path, name)
char *path; /* name of file being interrogated */
int name; /* property being inspected */
{
/* POSIX allows some of the values in <limits.h> to be increased at
* run time. The pathconf and fpathconf functions allow these values
* to be checked at run time. We do not use this facility.
*/
int fd;
long val;
if ( (fd = open(path, O_RDONLY)) < 0) return(-1L);
val = fpathconf(fd, name);
close(fd);
return(val);
}